import rxAjax from '@/assets/ajax.js';
export const instAndTaskShareApi = {};
instAndTaskShareApi.baseUrl = '/api-system/system/core'
//获取我的代码所属应用
instAndTaskShareApi.getMyOwnApp=function(parameter){
    let url= instAndTaskShareApi.baseUrl+"/sysApp/getMyOwnApp";
    return rxAjax.postJson(url,parameter).then (res => {
        return res
    });
}
//获取我的代码所属应用
instAndTaskShareApi.getMyOwnBpmApp=function(parameter){
    let url= instAndTaskShareApi.baseUrl+"/sysApp/getMyOwnBpmApp";
    return rxAjax.postJson(url,parameter).then (res => {
        return res
    });
}
//按分类和关键字检索二次开发的应用
instAndTaskShareApi.getByCategoryOrKey=function(parameter){
    let url= instAndTaskShareApi.baseUrl+"/sysApp/getByCategoryOrKey";
    return rxAjax.postForm(url,parameter).then (res => {
        return res
    });
}
//获取当前用户的应用管理授权
instAndTaskShareApi.getManagerOfCurUser=function(){
    let url= instAndTaskShareApi.baseUrl+"/sysAppManager/getManagerOfCurUser";
    return rxAjax.get(url).then (res => {
        return res
    });
}
instAndTaskShareApi.getByCatKey=function(key,isAdmin) {
    let url= instAndTaskShareApi.baseUrl + "/sysTree/getByCatKey";
    let params = {
        catKey:key,
        readKey:'start.mobileRead',
        isAdmin:isAdmin,
        isGrant:true,
        isI18:true
    }
    return rxAjax.postForm(url,params).then (res => {
        return res
    });
}
instAndTaskShareApi.getMyOwnByCatKey=function(key,isAdmin,isGrant,treeRootList,isMyBpm) {
    let url= instAndTaskShareApi.baseUrl+"/sysTree/getMyOwnByCatKey";
    let params = {
        catKey:key,
        readKey:'start.mobileRead',
        isAdmin:isAdmin,
        isGrant:isGrant,
        treeRootList:treeRootList,
        isMyBpm:isMyBpm,
        isI18:true
    }
    return rxAjax.postForm(url,params).then (res => {
        return res
    });
}
instAndTaskShareApi.getTreeCatByKey=function() {
    let url= "/api-system/system/core/sysTreeCat/getTreeCatByKey?catKey=" +'BPM&isI18=true';
    return rxAjax.get(url).then (res => {
        return res
    });
}
export default instAndTaskShareApi